#include <stdio.h>
#include <stdlib.h>

typedef struct{
    char code[6];
    char name[20];
    char description[40];
    int  semesters;
}structCourse;

int main(void){
    char option;

    for(;;){	
        system("cls");

        printf("********************************************************************************");
        printf("***                               MyDiscipline                               ***");
        printf("********************************************************************************\n");
        printf("SELECIONE UMA OPCAO: \n\n");
        printf("[1] Cadastrar Curso\n");
        printf("[2] Buscar Curso\n");
        printf("[3] Remover Curso\n");
        printf("[4] Atualizar Curso\n");
        printf("[X] Sair\n\n");

        fflush(stdin);
        option = getchar();

        switch(option){
            case '1':
                cadCourse();
                break;
            case '2':
                printf("2");
                break;
            default:
                exit(0);
                break;
        }
    }	
}

cadCourse(){
    structCourse course;
    printf("\nCADASTRO DE CURSO\n");

    printf("Digite o codigo do curso: ");
    fflush(stdin);
    gets(course.code);

    printf("Digite o nome do curso: ");
    fflush(stdin);
    gets(course.name);

    printf("Digite a descricao do curso: ");
    fflush(stdin);
    gets(course.description);

    printf("Digite a quantidade de semestres do curso: ");
    fflush(stdin);
    scanf("%d", &course.semesters);

    /*AQUI FAZ A CONSULTA PARA VERIFICAR SE O CURSO JÁ ESTA CADASTRADO*/

    savCourseFile(&course);
}

savCourseFile(structCourse *tmpCourse){
    printf("saveCourseFile");
}
